{% load static %}

<link rel="stylesheet" href="{% static 'ktag/css/tagify.css' %}">
<input placeholder="{{widget.attrs.placeholder}}" autocomplete="off" type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} />
<script>
    new Tagify(document.querySelector('input[name={{widget.name}}]'), {
    delimiters:"{{widget.ktag_args.delimiters}}",
    whitelist : {{widget.ktag_args.whitelist|safe}},
    suggestionsMinChars:{{widget.ktag_args.suggestionsMinChars}},
    blacklist:{{widget.ktag_args.blacklist|safe}},
    {% if widget.ktag_args.maxTags != None %}maxTags:{{widget.ktag_args.maxTags}}{%endif%}
    })
</script>